{% for user in users %}
    <div class="media user">
        <div class="media-left">
            {% set userHomeUrl = path('user_view', {'username': user.username}) %}
            <a href="{{ userHomeUrl  }}" class="avatar">
                <img src="{{ asset(user.avatar)|imagine_filter('middle_square') }}" class="media-object img-responsive img-circle">
            </a>
        </div>
        <div class="media-body">
            <div class="title"><a href="{{ userHomeUrl }}">{{ user.username }}</a></div>
            <div class="description">{{ user.description }}</div>
            <div class="meta">
                <ul class="list-unstyled list-inline">
                    <li>{{ user.followingCount }}关注</li>
                    <li>{{ user.followerCount }}粉丝</li>
                </ul>
            </div>
        </div>
        <div class="media-right">
            <div class="action" data-role="follow" data-username="{{ user.username }}">
                {% if (app.user and user.isFollowedBy(app.user)) %}
                    <button class="btn btn-sm btn-default" data-action="unfollow"><i class="if i-check"></i> 已关注</button>
                {% else %}
                    <button class="btn btn-sm u-btn-outline-primary" data-action="follow"><i class="if i-plus"></i> 关注</button>
                {% endif %}
            </div>
        </div>
    </div>
{% else %}
    <div class="empty-data">
        <i class="if i-user"></i> 没有用户
    </div>
{% endfor %}